package com.vic.mvc.prepare.design.proxy;
/*
 * 使用聚合的方式实现Car2代理Car
 */
public class Car3 implements MoveAble{
	
	Car car;
	
	public Car3(Car car){
		this.car = car;
	}
	

	@Override
	public void move() {
		long t1 = System.currentTimeMillis();
		System.out.println("START");
		//实现开车
		car.move();
		System.out.println("END");
		System.out.println("行驶时间：" + (System.currentTimeMillis() - t1) + "毫秒");
	}
	
	public static void main(String[] args) {
		Car c = new Car();
		MoveAble m = new Car3(c);
		m.move();
	}

}
